<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>保存包</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="保存,包">
	<meta http-equiv="description" content="This is my page">

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    	
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'保存包'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		
    		<s:hidden name="pack.id" id="packId"></s:hidden>
    		
    		<table width="98%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
    			<tr bgcolor="#FFFFFF">
    				<td width="20%" align="right" class="label">
    					包名称：
    				</td>
    				<td width="80%" align="left">
    					<s:textfield name="pack.packName" id="packName" cssStyle="width:160px" maxlength="20"></s:textfield>
    				</td>
    			</tr>
    			<tr bgcolor="#FFFFFF">
    				<td align="right" class="label">
    					内容：
    				</td>
    				<td align="left">
    					<s:textarea name="pack.packBodyStr" id="packBodyStr" cssStyle="width:100%; height:400px"></s:textarea>
    				</td>
    			</tr>
    		</table>
    		
    		<table width="100%" cellspacing="0">
    			<tr>
    				<td align="center" valign="bottom" height="30">
    					<input type="button" value="保存" class="btn" onclick="saveObj()" />
    					<input type="button" value="返回" class="btn" onclick="returnBack()" />
    				</td>
    			</tr>
    		</table>
    		
    		
    	</s:form>
    </center>
    
    <script type="text/javascript">
    $(function(){
		var baselib = 'baselib';
		var packName = $('#packName');
		if(baselib == packName.val())
		{
			packName.attr('readonly', true);
		}
    });
    
    function saveObj()
    {
    	var packName = $('#packName');
    	if(!isNotNull(packName.val()))
    	{
    		showMsg('包名称不能为空。', function(){packName.focus();});
    		return;
    	}
    	var url = 'inner/data/savePack.action';
    	ajaxAction(url, 'post', 'frm', true, function(result){
			var obj = eval(result);
			if('success' == obj.result)
			{
				var url = realPath + '/inner/data/packManage.action?lvvo.listCode=other_package';
				window.location.href = url;
			}
			else
			{
				showMsg(obj.message);
			}
        });
    }

    function returnBack()
    {
    	var url = realPath + '/inner/data/packManage.action?lvvo.listCode=other_package';
		window.location.href = url;
    }
    </script>
  </body>
</html>
